<!DOCTYPE html>
<html>
<head>
	<title>proxy</title>
</head>
<body>
<script type="text/javascript">
	
let obj = {name: 'libai', age: 12};
obj = new Proxy(obj, {
	set(target, key, val, old) {
		console.log('setting');
		return target[key] = val;
	},
	get(target, key, receiver) {
		return target[key];
	}
});
obj.name = 'ok';
console.log(obj);
console.log(obj.name);

</script>
</body>
</html>